import { BaseItem } from "../../../common/BaseItem";
import { RuneItemData } from "../data/RuneItemData";
import { FilterConst } from "../../../../../component/gconst/FilterConst";
//class RuneItem
    
    export  class RuneItem extends BaseItem
    {
        constructor()
        {
            super();
            isShowLock = true;
            _bitmap.x = 3;
            _bitmap.y = 3;
            return;
        }

        protected /* override */ resetBitmapSize(): void
        {
            if (_bitmap) 
            {
                _bitmap.width = _width - 4;
                _bitmap.height = _height - 4;
            }
            return;
        }

        protected /* override */ set isBind(arg1: Boolean)
        {
            super.isBind = arg1;
            if (lockedIcon) 
            {
                var loc1;
                lockedIcon.y = loc1 = 2;
                lockedIcon.x = loc1;
            }
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            if (typeof arg1 === "runeitemdata") 
            {
                this._runeItemData = arg1 as RuneItemData;
                this.itemData = this._runeItemData.itemData;
                this.locked = !this._runeItemData.isCanInsert;
            }
            return;
        }

        public /* override */ set selected(arg1: Boolean)
        {
            super.selected = arg1;
            if (arg1 && itemData) 
            {
                this.filters = [FilterConst.itemChooseFilter];
            }
            else 
            {
                this.filters = [];
            }
            return;
        }

        /* internal */ /* var */_runeItemData: RuneItemData;
    }
